<%--
  Created by IntelliJ IDEA.
  User: jia19
  Date: 2015/9/17
  Time: 23:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <meta charset="utf-8" />
    <title>BookStore——我的网上书店</title>
    <%@ include file="../layout/import.jsp"%>


    <script language="JavaScript">
        function orderBook(bookid) {
            $.ajax({
                url: "/orderbook.do",
                data: {id:bookid},
                method: "POST",
                dataType: "json",
                error: function () {
                    alert("表单提交出错，请稍后再试");
                },
                success: function(response) {
                    if(response.code == 0) {
                        window.location.href = "/orderbook.do";
                    }
                    else {
                        alert(response.description);
                    }
                }
            });
        }
    </script>
</head>
<body>
<%@include file="nav.jsp"%>

    <div class="container">

        <div class="row row-offcanvas row-offcanvas-right">

            <div class="col-xs-12 col-sm-9">
                <div class="jumbotron">
                    <h1>新书上架</h1>
                    <p>
                        书店成立3周年，感恩大回馈！！！！！！！！！！！！！！！
                    </p>


                </div>

                <div class="row" id="bookshow" style="min-height: 75%">
                    <c:forEach var="book" items="${bookList}">
                        <div class="col-xs-6 col-lg-4">
                            <h2>
                                    ${book.bookname}
                            </h2>
                            <p>
                                <a href="/bookDetail.do?id=${book.id}"><img style="width: 200px; height: 400px" src="${book.picture}" class="img-thumbnail"></a>
                            </p>
                            <p>
                                <a href="/bookDetail.do?id=${book.id}" class="btn btn-default" role="button">详细&raquo;</a>
                            </p>
                        </div>
                    </c:forEach>

                </div><!--/row-->
            </div>
        </div>
    </div>

<%@include file="footer.jsp"%>
</body>

</html>
